﻿using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;

namespace Asdo.Controls
{
    /// <summary>
    /// Interaction logic for Thumbs.xaml
    /// </summary>
    public partial class ThumbWindow : Window
    {
        private DependencyObject _pad;

        public ThumbWindow()
        {
            InitializeComponent();

            AllowsTransparency = true;
            AllowDrop = false;
            Background = null;
            IsHitTestVisible = false;

            Topmost = true;
            ShowInTaskbar = false;

        }

        public ThumbWindow(object data) : this()
        {
            _pad = (DependencyObject) data;
            if (_pad is HeaderedContentControl)
            {
                DataContext = _pad;
            }
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            _pad = null;
            base.OnClosing(e);
        }
    }
}
